#include <iostream>
#include <cstring>

using namespace std;

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
	int t;
	cin >> t;
	while(t--){
		string s;
		cin >> s;
		if(s[1] == '+' || s[1] == '*'){
			if(s[0] != s[2]){
				cout << "Yes";
			}else{
				cout << "No";
			}
		}else{
			if(s[0] == '0' && s[2] != '0'){
				cout << "Yes";
			}else{
				cout << "No";
			}
		}
		if(t) cout << endl;
	}

	return 0;
}

